############################################################################            
#                           APPLICATION                                    #
############################################################################

import cgi
import admin
import api
import files
import logging
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app



logging.getLogger().setLevel(logging.INFO)


         
application = webapp.WSGIApplication(
                                     [('/Admin'               , admin.AdminPage)      ,
                                      ('/SendMessage'         , api.SendMessage)      ,
                                      ('/SendYouTube'         , api.SendYouTube)      ,
                                      ('/RemoveMessage'       , api.RemoveMessage)    ,
                                      ('/CreateRoom'          , api.CreateRoom)       ,
                                      ('/RemoveRoom'          , api.RemoveRoom)       ,
                                      ('/AddMember'           , api.AddMember)        ,
                                      ('/RemoveMember'        , api.RemoveMember)     ,
                                      ('/ChangeNick'          , api.ChangeNick)       ,
                                      ('/GetRoomMessages'     , api.GetRoomMessages)  ,
                                      ('/GetRoomMembers'      , api.GetRoomMembers)   ,
                                      ('/GetUserRooms'        , api.GetUserRooms)     ,
                                      ('/GetRoomStatistics'   , api.GetRoomStatistics),
                                      ('/GetWordCount'        , api.GetWordCount)     ,
                                      ('/CreatePoll'          , api.CreatePoll)       ,
                                      ('/AnswerPoll'          , api.AnswerPoll)       ,
                                      ('/GetRoomPolls'        , api.GetRoomPolls)     ,
                                      ('/GetWordCount'        , api.GetWordCount)     ,
                                      ('/GetUserFeed'         , api.GetUserFeed)      ,
                                      ('/NumOfNewMessages'    , api.NumOfNewMessages) ,                                      
                                      ('/StaticFile/Edit/(.*)', files.EditFile)       ,
                                      ('/StaticFile/(.*)'     , files.GetFile)        ,
                                      ('/TrancateDB'          , admin.TrancateDB),  
                                      ('/', admin.MainPage)],
                                     debug = True)



def main():
  run_wsgi_app(application)
if __name__ == "__main__":
  main()